home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / msdos / editors / eedraw / src / eep / eelibsl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-28  |  3.1 KB  |  93 lines

  1. /*****************************************************************************
  2. *   Local definitions of the EELibs?.c modules.                     *
  3. *                                         *
  4. * Written by:  Gershon Elber            IBM PC Ver 1.0,    Oct. 1989    *
  5. *****************************************************************************/
  6.  
  7. #ifndef EELIBSL_H
  8. #define EELIBSL_H
  9.  
  10. #define PART_NAME_LEN    15             /* Maximum length of part name. */
  11. #define PREFIX_NAME_LEN    5      /* Maximum length of prefix (IC, R, SW etc.). */
  12. #define PIN_SEPERATOR    "\n"          /* See Pins in LibraryEntryStruct. */
  13. #define FILE_IDENT    "EEDRAW-LIB"       /* Must be at the lib file start. */
  14. #define PIN_WIDTH    96          /* Width between 2 pins in pixels. */
  15. #define PIN_LENGTH    192          /* Length of each pin to be drawn. */
  16. /* Between height and width of chip (for pin desc. text inside/outside).     */
  17. #define CHIP_BOX_ASPECT_TO 0.4
  18. #define CHIP_BOX_ASPECT_TI 0.7
  19. #define INVERT_PIN_RADIUS LIB_SCALE_DRAW   /* Radius of inverted pin circle. */
  20.  
  21. /* THe width/height of one character in drawing space: */
  22. #define DRAW_TEXT_WIDTH  (8 << IG_DEFAULT_ZOOM_FACTOR)
  23. #define DRAW_TEXT_HEIGHT  (8 << IG_DEFAULT_ZOOM_FACTOR)
  24.  
  25. /* Normalize angle to be in the 0..360 range: */
  26. #define    NORMALIZE_ANGLE(Angle)    { while (Angle < 0) Angle += 360; \
  27.                   while (Angle > 360) Angle -= 360; }
  28.  
  29. typedef enum {
  30.     ARC_DRAW_TYPE,
  31.     CIRCLE_DRAW_TYPE,
  32.     TEXT_DRAW_TYPE,
  33.     SQUARE_DRAW_TYPE,
  34.     LINE_DRAW_TYPE,
  35.     POLYLINE_DRAW_TYPE
  36. } LibDrawStructType;
  37.  
  38. typedef struct LibraryDrawArc {
  39.     int x, y, r, t1, t2;
  40. } LibraryDrawArc;
  41. typedef struct LibraryDrawCircle {
  42.     int x, y, r;
  43. } LibraryDrawCircle;
  44. typedef struct LibraryDrawText {
  45.     TextOrientationType Horiz;
  46.     int x, y;
  47.     char *Text;
  48. } LibraryDrawText;
  49. typedef struct LibraryDrawSquare {
  50.     int x1, y1, x2, y2;
  51. } LibraryDrawSquare;
  52. typedef struct LibraryDrawLine {
  53.     int x1, y1, x2, y2;
  54.     BooleanType Invert;
  55. } LibraryDrawLine;
  56. typedef struct LibraryDrawPolyline {
  57.     int n, *PolyList;
  58.     BooleanType Fill;
  59. } LibraryDrawPolyline;
  60.  
  61. typedef struct LibraryDrawEntryStruct {
  62.     LibDrawStructType DrawType;
  63.     char Layer;
  64.     union {
  65.     LibraryDrawArc Arc;
  66.     LibraryDrawCircle Circ;
  67.     LibraryDrawText Text;
  68.     LibraryDrawSquare Sqr;
  69.     LibraryDrawLine Line;
  70.     LibraryDrawPolyline Poly;
  71.     } U;
  72.     struct LibraryDrawEntryStruct *Pnext;
  73. } LibraryDrawEntryStruct;
  74.  
  75. typedef struct LibraryEntryStruct {
  76.     char Name[PART_NAME_LEN + 1];                   /* Part name. */
  77.     char Prefix[PREFIX_NAME_LEN + 1];
  78.     int NumOfPins, NumOfUnits, PinsPerUnit;
  79.     BooleanType TextInside, DrawNums, DrawName;
  80.     char *Pins;               /* All pin names, seperated by PIN_SEPERATOR. */
  81.     LibraryDrawEntryStruct *Drawings;           /* How to draw this part. */
  82.     int *Multi;               /* Hold MULTI/ENDMULTI block as linear array. */
  83.     int BBoxMinX, BBoxMaxX, BBoxMinY, BBoxMaxY;     /* BBox around the part. */
  84. } LibraryEntryStruct;
  85.  
  86. extern LibraryStruct *LibraryList;        /* All part libs are saved here. */
  87.  
  88. /* Functions common to all EELibs?.c modules: */
  89. int LibraryEntryCompare(LibraryEntryStruct *LE1,
  90.             LibraryEntryStruct *LE2);
  91.  
  92. #endif EELIBSL_H
  93.